<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
	<title>管理员管理</title>


	<!-- Bootstrap CSS -->
	<link rel="stylesheet" href="__INDEX__/css/bootstrap.min.css">

	<!-- Fontawesome CSS -->
	<link rel="stylesheet" href="__INDEX__/plugins/fontawesome/css/fontawesome.min.css">
	<link rel="stylesheet" href="__INDEX__/plugins/fontawesome/css/all.min.css">

	<!-- calendar CSS -->
	<link rel="stylesheet" href="__INDEX__/plugins/simple-calendar/simple-calendar.css">

	<!-- Feathericon CSS -->
	<link rel="stylesheet" href="__INDEX__/css/feather.css">

	<!-- Main CSS -->
	<link rel="stylesheet" href="__INDEX__/css/style.css">
</head>
<body>
<!-- Main Wrapper -->
<div class="main-wrapper">
	<!-- Header -->
	{include file="Include/top"}
	<!-- /Header -->

	<!-- Sidebar -->
	{include file="Include/left"}
	<!-- /Sidebar -->

	<!-- Page Wrapper -->
	<div class="page-wrapper">
		<div class="content container-fluid">
			<div class="card">
				<div class="card-header no-border">
					<h4 class="card-title float-left" style="margin: 1.5em 0 0 0 ;">管理员信息</h4>
					<div class="card-header no-border" >
						<form action="/admin.php/User/index" method="get" autocomplete="off">
							<div class="form-group row">
								<div class="col-md-10">
									<input type="text" name="name" value="{$name|default=''}" class="form-control" placeholder="请输入管理员账户名称" style="width:70em;display:inline;margin: 0 0 0 3em;">
									<button type="submit" class="btn btn-primary" style="height: 48px;margin-left:10px;">搜索</button>
								</div>
							</div>

						</form>
					</div>

					<div style="margin: -4em 0 0 90%;">
						<td class="text-right">
							<a href="/admin.php/User/add" class="btn btn-sm btn-white text-success mr-2"><i class="far fa-edit mr-1"></i> 添加</a>
						</td>
					</div>
				</div>

				<div class="card-body">

					<div class="table-responsive">

						<table class="table mb-0">
							<thead>
							<tr>
								<th>ID</th>
								<th>姓名</th>
								<th>等级</th>
								<th>注册时间</th>
<!--								<th>状态</th>-->
								<th class="text-right">操作</th>
							</tr>
							</thead>
							<tbody>
							{volist name="list" id="vv"}
							<tr>
								<td>{$vv.id}</td>
								<td>{$vv.name}</td>
								<td>{if condition="$vv.level eq 0"}超级管理员{else}管理员{/if}</td>

								<td>{$vv.addtime|date="Y-m-d H-i-s"}</td>
<!--								<td class="text-success">-->
<!--									{if condition="$vv.stutic eq 1"}-->
<!--									<button type="button" class="btn btn-info" onclick="clockbtn1(this,'{$vv.id}')">启用</button>-->
<!--									{else}-->
<!--									<button type="button" class="btn btn-dark" onclick="clockbtn2(this,'{$vv.id}')">停用</button>-->
<!--									{/if}-->
<!--								</td>-->
								<td class="text-right">
									<a href="/admin.php/User/edit?id={$vv.id}" class="btn btn-sm btn-white text-success mr-2"><i class="far fa-edit mr-1"></i> 修改</a>
									<a href="javascript:void(0);"  onclick="member_del(this,'{$vv.id}');"  class="btn btn-sm btn-white text-danger mr-2"><i class="far fa-trash-alt mr-1"></i>删除</a>
								</td>
							</tr>
							{/volist}
							</tbody>
						</table>
					</div>
					<div class="row" style="margin-left: 85%;height: 45px;width:100%;">
						<div class="btn btn-default col-xs-12 col-sm-6 col-md-8">
							{$list|raw}
						</div>
					</div>

				</div>
			</div>
		</div>
	</div>
	<!-- /Page Wrapper -->

	<!-- Notification -->
	<!-- /Notification -->
</div>
<!-- /Main Wrapper -->
<script>
	function member_del(obj, id){
		$.ajax({
			url:'/admin.php/index/del',
			type: 'get',
			data: {'id':id},
			dataType: 'json',
			success:function(res){
				if(res.code == 1){
					success(res);
				}else{
					console.log('success', res);
				}
			},
			fail:function(res){
				console.log('成功但响应出错', res)
			}

		})
	}
</script>
<script>
	function clockbtn2(obj,id){
		$.ajax({
			url:'/admin.php/index/edit_stutic',
			type: 'post',
			data: {'id':id},
			dataType: 'json',
			success:function(res){
				if(res.code == 1){
					success(res);
				}else{
					console.log('success', res);
				}
			},
			fail:function(res){
				console.log('成功但响应出错', res)
			}

		})
	}
</script>
<script>
	function clockbtn1(obj,id){
		$.ajax({
			url:'/admin.php/index/edit_stutic',
			type: 'post',
			data: {'id':id},
			dataType: 'json',
			success:function(res){
				if(res.code == 1){
						success(res);
				}else{
					console.log('success', res);
				}
			},
			fail:function(res){
				console.log('成功但响应出错', res)
			}
		})
	}
</script>
<!-- jQuery -->
<script src="__INDEX__/js/jquery-3.6.0.min.js"></script>

<!-- Bootstrap Core JS -->
<script src="__INDEX__/js/bootstrap.bundle.min.js"></script>

<!-- Slimscroll JS -->
<script src="__INDEX__/plugins/slimscroll/jquery.slimscroll.min.js"></script>

<!-- Chart JS -->
<script src="__INDEX__/plugins/apexchart/apexcharts.min.js"></script>
<script src="__INDEX__/plugins/apexchart/dsh-apaxcharts.js"></script>

<!-- calendar Js -->
<script src="__INDEX__/plugins/simple-calendar/jquery.simple-calendar.js"></script>
<script src="__INDEX__/js/calander.js"></script>

<!-- Custom JS -->
<script  src="__INDEX__/js/script.js"></script>
</body>
</html>
